<template>
  <!-- 分类 -->
  <div class="classifcation">
    <!-- 分类头部  -->
    <van-search
      v-model="searchVal"
      placeholder="请输入搜索关键词"
      disabled
      @click="$router.push('/home/searchPopup')"
    />
    <!-- 左右分类 -->
    <van-tree-select
      v-for="e in items"
      :key="e.id"
      height="100vw"
      :items="items.name"
      :main-active-index.sync="active"
    >
      <template #content>
        <van-image
          v-if="active === 0"
          src="https://img.yzcdn.cn/vant/apple-1.jpg"
        />
        <van-image
          v-if="active === 1"
          src="https://img.yzcdn.cn/vant/apple-2.jpg"
        />
      </template>
    </van-tree-select>
  </div>
</template>

<script>
import { GetClassification } from "@/request/api";
export default {
  data() {
    return {
      searchVal: "",
      active: 0,
      items: [],
    };
  },
  created() {
    GetClassification().then((res) => {
      console.log(res);
      this.items = res.data.categoryList;
    });
  },
};
</script>
 
<style lang = "less" scoped>
</style>